﻿using System.Data.Entity.Migrations;
using Yz.Model.Constants;

namespace Yz.Model.Dal
{
    public sealed class Configuration : DbMigrationsConfiguration<YzContext>
    {
        /// <summary>
        ///     配置，数据结构有变更时，支持数据迁移
        /// </summary>
        public Configuration()
        {
            if (Config.EFMigration)
            {
                AutomaticMigrationsEnabled = true;
                AutomaticMigrationDataLossAllowed = true;
                //数据迁移超时时间设置为1小时
                CommandTimeout = 3600;
            }
            ContextKey = "YzContext";
        }

        protected override void Seed(YzContext context)
        {

        }
    }
}
